<template>
  <!-- 基本信息 -->
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">基本信息</BaseHead>
    <BaseTable>
      <tr>
        <td class="td-name">结项日期</td>
        <td style="width: 85%">{{ detailData.completeDate }}</td>
      </tr>
      <tr v-if="detailData.projectClass != 'xJProject'">
        <td class="td-name">验收类别</td>
        <td>
          <CommonLabel isFetch paramsName="验收类别" :value="detailData.acceptanceType" />
        </td>
      </tr>
      <tr>
        <td class="td-name">结项报告</td>
        <td>
          <p v-for="item in fileList" :key="item.id" class="my-[5px]">
            {{ item.name }}
            <el-link type="primary" @click="handleDownload(item.id, item.name)" class="ml-[5px]"
              >下载</el-link
            >
          </p>
        </td>
      </tr>
      <tr>
        <td class="td-name">结项说明</td>
        <td>{{ detailData.note }}</td>
      </tr>
    </BaseTable>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import BaseTable from "@/views/project/components/BaseTable.vue";
import CommonLabel from "@/views/project/components/CommonLabel.vue";
import { handleDownload } from "@/utils/main";
const props = defineProps({
  detailData: {
    type: Object,
    default: () => ({}),
  },
});
const fileList = computed(() => {
  const list = [];
  if (props.detailData.fileId) {
    list.push({
      name: props.detailData.fileName,
      id: props.detailData.fileId,
    });
  }
  return list;
});
</script>

<style scoped lang="scss"></style>
